package com.test.restassured;


import io.restassured.response.Response;

import static io.restassured.RestAssured.given;

public class ResponseInfo {
    public static void main(String[] args) {
        Response response = given()
                .when().get("http://mall.lemonban.com:8107/search/searchProdPage?prodName=真皮圆筒包")
                .then().log().all().extract().response();

        // log().all() 把响应信息全部直接打印到控制台
        // 提取响应体里面某个信息，1、断言；2、传递给后面的接口使用

        // 响应状态码
        System.out.println(response.statusCode());
        // 响应时间,ms
        System.out.println(response.time());
        // 响应头
        System.out.println(response.getHeaders());
        System.out.println(response.getHeader("Content-Type"));  // application/json
        System.out.println(response.header("Content-Type"));  // application/json

    }
}
